if(typeof vlib!='undefined')
{var _vlib=vlib;throw'vlib defined before the core loaded.';}
var vlib={Version:'0.1',Util:['Ajax','Array','Cookie','Dom','Event','Template','Json','String'],FF:navigator.userAgent.toLowerCase().indexOf('firefox')!=-1,IE:navigator.userAgent.toLowerCase().indexOf('msie')!=-1};$=function()
{var ret=(arguments.length==0)?null:[];if(arguments.length==1)
{if(typeof arguments[0]!='string')
ret=arguments[0];else
{var m=/^(\w+)$|^#([\w| ]+)$|^(\w+) #(\w+)$|^(\w+) :(\w+)$/.exec(arguments[0]);if(m&&m[1])
ret=document.getElementById(m[1]);else if(m&&(m[2]||m[3]&&m[4]))
{var c=document.getElementsByTagName(m[3]||'*');for(var i=0,len=c.length;i<len;i++)
if(c[i].className.match(new RegExp("(^|\\s)"+(m[4]||m[2])+"(\\s|$)")))
ret.push(c[i]);ret=(ret.length>=1)?ret:document.getElementById(arguments[0]);}
else if(m&&m[5]&&m[6])
{var c=document.getElementsByTagName(m[5]);for(var i=0,len=c.length;i<len;i++)
if(!isNull(c[i].getAttribute(m[6])))
ret.push(c[i]);}}}
else if(arguments.length>1)
{for(var i=0,len=arguments.length;i<len;i++)
ret.push($(arguments[i]));}
return ret;}
isNull=function(o)
{return(o==""||o==null||o=="undefined");}
$.ajax=function(url,method,param,callback,type,timeout)
{var method=method||'get',param=param||'',type=type||'text';var finish=false,callback=callback||{};var xhr=(function()
{try{return new XMLHttpRequest();}catch(e){var _o=['Microsoft.XMLHTTP','MSXML2.XMLHTTP.5.0','MSXML2.XMLHTTP'];for(var i=0;i<_o.length;i++)
{try{return new ActiveXObject(_o[i]);}catch(e){}}}})();url=(method=='get')?url+'?'+param:url;xhr.open(method,url,true);(method=='get')||xhr.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xhr.send(((method=='get')?null:param));xhr.onreadystatechange=function()
{if(xhr.readyState==2&&typeof callback.Loading=='function')
callback.Loading((type=='text')?xhr.responseText:xhr.responseXML);if(xhr.readyState==4&&xhr.status==200&&typeof callback.Complete=='function')
{callback.Complete((type=='text')?xhr.responseText:xhr.responseXML);finish=true;}}
if(typeof timeout=='number'&&timeout>0)
{setTimeout(function(){if(xhr&&!finish){xhr.abort();(callback.Timeout||function(){})();}},timeout);}
return xhr;}
$.grep=function(elems,fn,inv)
{for(var i=0,el=elems.length,result=[];i<el;i++)
if(!inv&&fn(elems[i],i)||inv&&!fn(elems[i],i))
result.push(elems[i]);return result;}
$.uniq=function(elems)
{var result=[],done={};for(var i=0,len=elems.length;i<len;i++)
{if(!done[elems[i]])
{done[elems[i]]=true;result.push(elems[i]);}}
return result;}
$.inArray=function(b,a)
{for(var i=0,al=a.length;i<al;i++)
if(a[i]==b)
return i;return-1;}
$.cookie=function(name,value,options)
{if(typeof value=='undefined')
{if(m=new RegExp("(^|)"+name+"=([^;]*)(;|$)","gi").exec(document.cookie))
return decodeURIComponent(m[2]);}
else
{var s=name+'='+encodeURIComponent(value);if(typeof options=='object')
{for(var i in options)
s+=options.hasOwnProperty(i)?'; '+i+'='+options[i]:'';}
return(document.cookie=s+'; ');}
return false;}
$.attr=function(elem,key,value)
{var value=value||null,r=[];if(elem.constructor==Array)
for(var i=0,len=elem.length;i<len;i++)
r.push($.attr(elem[i],key,(value.constructor==Array)?value[i]:value));if(elem.constructor==String)
{elem=$(elem);if(isNull(value))
return elem.getAttribute(key);else
elem.setAttribute(key,value);}
return isNull(value)?r:true;}
$.css=function(elem,cfg)
{var tmp=$(elem);if(cfg.constructor==String)
return eval('tmp.style.'+cfg);if(cfg.constructor==Object)
{for(var i in cfg)
{if(cfg.hasOwnProperty(i))
eval('tmp.style.'+i+'="'+cfg[i]+'"');}}
return true;}
$.toggleClass=function(elem,c)
{return $(elem).className=($(elem).className==c)?'':c;}
$.toggle=function()
{for(var i=0;i<arguments.length;i++)
{var e=$(arguments[i]);e.style.display=(e.style.display!='none')?'none':'';}}
$.tab=function(tabs,cfg)
{cfg=cfg||{};this.elem=function(event)
{o=(vlib.IE)?event.srcElement:event.target;for(var i=0;i<tabs.length;i++)
{if(tabs[i]==o.id.substr(1))
{if(cfg['active'])
o.className=cfg['active'];$(tabs[i]).style.display='';}
else
{if(cfg['inactive'])
$('#'+tabs[i]).className=cfg['inactive'];$(tabs[i]).style.display='none';}}}
for(var i=0;i<tabs.length;i++)
$.addEvt($('#'+tabs[i]),'click',this.elem);}
$.hide=function()
{for(var i=0;i<arguments.length;i++)
$(arguments[i]).style.display='none';}
$.show=function()
{for(var i=0;i<arguments.length;i++)
$(arguments[i]).style.display='';}
$.addEvt=function(obj,evt,fn)
{obj=(typeof obj=='string')?$(obj):obj;if(obj.constructor==Array)
{for(var i=0,len=obj.length;i<len;i++)
$.addEvt(obj[i],evt,fn)}
else
{try{obj.addEventListener(evt,fn,false);}catch(e){try{obj.attachEvent('on'+evt,fn);}catch(e){}}}
return true;}
$.delEvt=function(obj,evt,fn)
{obj=(typeof obj=='string')?$(obj):obj;if(obj.constructor==Array)
{for(var i=0,len=obj.length;i<len;i++)
$.addEvt(obj[i],evt,fn)}
else
{try{obj.removeEventListener(evt,fn,false);}catch(e){try{obj.detachEvent('on'+evt,fn);}catch(e){}}}
return true;}
$.onReady=function(fn)
{if(vlib.IE)
{document.write('<script id="__ie_onload" defer="true" src="://"></script>');$('__ie_onload').onreadystatechange=function(){if(this.readyState=='complete')fn();};}
else if(vlib.FF)
document.addEventListener('DOMContentLoaded',fn,false);return true;}
$.json=function(o)
{var useHasOwn={}.hasOwnProperty?true:false;var d=true;var pad=function(n)
{return n<10?"0"+n:n;};var m={"\b":'\\b',"\t":'\\t',"\n":'\\n',"\f":'\\f',"\r":'\\r','"':'\\"',"\\":'\\\\'};var encodeString=function(s)
{if(/["\\\x00-\x1f]/.test(s)){return'"'+s.replace(/([\x00-\x1f\\"])/g,function(a,b){var c=m[b];if(c){return c;}
c=b.charCodeAt();return"\\u00"+
Math.floor(c/16).toString(16)+
(c%16).toString(16);})+'"';}
return'"'+s+'"';};var encodeArray=function(o)
{var a=["["],b,i,l=o.length,v;for(i=0;i<l;i+=1){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(',');}
a.push(v===null?"null":encode(v));b=true;}}
a.push("]");return a.join("");};var encodeDate=function(o)
{return'"'+o.getFullYear()+"-"+
pad(o.getMonth()+1)+"-"+
pad(o.getDate())+"T"+
pad(o.getHours())+":"+
pad(o.getMinutes())+":"+
pad(o.getSeconds())+'"';};var encode=function(o)
{if(typeof o=="undefined"||o===null){return"null";}else if(o instanceof Array){return encodeArray(o);}else if(o instanceof Date){return encodeDate(o);}else if(typeof o=="string"){return encodeString(o);}else if(typeof o=="number"){return isFinite(o)?String(o):"null";}else if(typeof o=="boolean"){return String(o);}else{var a=["{"],b,i,v;for(i in o){if(!useHasOwn||o.hasOwnProperty(i)){v=o[i];switch(typeof v){case"undefined":case"function":case"unknown":break;default:if(b){a.push(',');}
a.push(encode(i),":",v===null?"null":encode(v));b=true;}}}
a.push("}");return a.join("");}};if(typeof o=='string'&&d)
return eval("("+o+')');else
{d=false;return encode(o)}}
$.trim=function(t)
{return(t||'').replace(/^\s+|\s+$/g,'');}
$.tmplate=function(tpl,data)
{var key='',val='"',m=false,ret='';for(var i=0,len=tpl.length;i<len;i++)
{if(tpl.charAt(i)=='}'&&m)
{val+='" + data[i]["'+key+'"] +"';m=false;key='';}
else if(tpl.charAt(i)=='{'||m)
{key+=(m)?tpl.charAt(i):'';m=true;}
else
val+=tpl.charAt(i);}
val+='"';data=(data.constructor==Array)?data:[data];for(i=0,len=data.length;i<len;i++)
ret+=eval(val);return ret;}